package com.ckv.qcm.model.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import com.ckv.qcm.model.Session;
import com.ckv.qcm.model.Trainee;

public class SessionDAO extends DAO
{

	public Session find(long id)
	{

		Session session = new Session();

		try
		{
			ResultSet result = this.connection.createStatement().executeQuery(
					"SELECT * FROM Sessions WHERE idSession=" + id);

			if (result.next())
			{
				return new Session(result.getLong("idSession"),result.getLong("idTest"),result.getDate("dateDebut"),result.getDate("dateFin"));
			}

		}
		catch (SQLException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;

	}

	public ArrayList<Session> findAll()
	{
		// TODO Auto-generated method stub
		return null;
	}

	public Session create(Session obj)
	{
		// TODO Auto-generated method stub
		return null;
	}

	public Session update(Session obj)
	{
		// TODO Auto-generated method stub
		return null;
	}

	public void delete(Session obj)
	{
		// TODO Auto-generated method stub

	}

}
